package com.ludomancy.starwave;

import java.awt.Color;
import java.awt.Image;
import java.awt.Point;

import com.ludomancy.gamelib.ImageStrip;
import com.ludomancy.gamelib.ResourceManager;

public class Settings
{
	public static final int TILE_SIZE = 32;
	public static final Point SHIP_ICON_AMOUNT_POSITION = new Point(TILE_SIZE-5, TILE_SIZE-5);
	public static final Color SHIP_ICON_AMOUNT_COLOR = new Color(240, 240, 240);
	public static final Color UI_BORDER_COLOR = new Color(110, 110, 110);
	public static final Color GRID_LINES_COLOR = new Color(60, 60, 60);
	public static final int HULL_BAR_HEIGHT = 5;
	public static final int MOTHERSHIP_OFFSET_Y = 8;
	
	// dialogs
	public static final int DIALOG_WIDTH = 330;
	public static final int DIALOG_HEIGHT = 220;
	public static final int DIALOG_TEXT_HEIGHT = DIALOG_HEIGHT - 40;
	
	//animations
	public static final int MOVE_SHIP_FRAME_TIME = 8;
	public static final int ATTACK_SHIP_KICKBACK_FRAME_TIME = 2;
	public static final int ATTACK_SHIP_KICKBACK_DEPTH = 8;
	public static final int EXPLOSION_FRAME_TIME = 2;
	public static final int MOTHERSHIP_DEATH_ANIMATION_FRAME_TIME = 3;
	public static final int PORTAL_TELEPORT_STEPS = 6;
	
	public static ImageStrip portalStrip = null;
	
	public static ImageStrip getPortalStrip()
	{
		if(portalStrip == null)
		{
			portalStrip = new ImageStrip(ResourceManager.getImage("portal.png"), 32, 32);
		}
		return portalStrip;
	}
	
	private static ImageStrip explosionStripHuman;
	private static ImageStrip explosionStripAlien;
	
	public static ImageStrip getExplosion(int direction)
	{
		if(explosionStripHuman == null)
		{
			explosionStripHuman = new ImageStrip(ResourceManager.getImage("explosion.png"), 32, 32);
			explosionStripAlien = new ImageStrip(ResourceManager.getImage("explosion_me.png"), 32, 32);
		}
		return direction > 0 ? explosionStripHuman : explosionStripAlien;
	}
	
	public static Image getMothershipIcon(int direction)
	{
		return ResourceManager.getImage(direction > 0 ? "planet.png" : "planet.png");
	}
			
}
